package com.dsg.entity.approve;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 實例動態表
 * </p>
 *
 * @author system
 * @since 2020-07-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dsg_approve_case")
@ApiModel(value = "DsgApproveCase对象", description = "實例動態表")
public class DsgApproveCase implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主鍵")
    @TableId("OID")
    private String oid;

    @ApiModelProperty(value = "節點配置ID")
    @TableField("TASK_ID")
    private String taskId;

    @ApiModelProperty(value = "申請單APPLY_NO")
    @TableField("APP_NO")
    private String appNo;

    @ApiModelProperty(value = "用戶ID")
    @TableField("USER_ID")
    private String userId;

    @ApiModelProperty(value = "狀態")
    @TableField("STATUS")
    private Integer status;

    @ApiModelProperty(value = "審批意見")
    @TableField("AP_OPINIONS")
    private String apOpinions;


    /**
     * 创建人
     */
    @TableField(value = "CREATER")
    @ApiModelProperty(value = "创建人", name = "creater")
    private String creater;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @ApiModelProperty(value = "创建时间", name = "createTime")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField(value = "UPDATER")
    @ApiModelProperty(value = "更新人", name = "updater")
    private String updater;

    /**
     * 更新时间
     */
    @TableField(value = "UPDATE_TIME")
    @ApiModelProperty(value = "更新时间", name = "updateTime")
    private Date updateTime;

    /**
     * 企業編號
     */
    @TableField(value = "ENT_CODE")
    @ApiModelProperty(value = "企業編號", name = "entCode")
    private String entCode;

    /**
     * 前節點
     */
    @TableField(value = "NODE_ID")
    @ApiModelProperty(value = "前節點", name = "nodeId")
    private String nodeId;

    /**
     * 任務優先順序
     */
    @TableField(value = "TASK_PRIORITY")
    @ApiModelProperty(value = "任務優先順序", name = "taskPriority")
    private String taskPriority;
    /**
     * 派發人
     */
    @TableField(value = "SEND_ID")
    @ApiModelProperty(value = "派發人", name = "sendId")
    private String sendId;
    /**
     * 派發時間
     */
    @TableField(value = "SEND_TIME")
    @ApiModelProperty(value = "派發時間", name = "sendTime")
    private String sendTime;

    @ApiModelProperty(value = "任務名稱")
    @TableField(exist = false)
    private String taskName;

    @ApiModelProperty(value = "用戶真實姓名")
    @TableField(exist = false)
    private String userName;

    public enum Status {
        /** 已開始 */
        started(0),
        /** 已審批 */
        approved(1),
        /** 已回退 */
        undo(2),
        /** 已暫停 */
        suspended(3),
        /** 已指派 */
        assigned(4),
        /** 已結束 */
        end(5);

        Integer code;

        Status(Integer code) {
            this.code = code;
        }

        public Integer getCode() {
            return code;
        }
    }
}
